<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件绑定</title>
</head>
<body>
<div id="div">
   <!--1-->
    <div>{{name}}</div>
   <!--2-->
    <button onclick="changeName()">改变div的内容</button>
   <!--3-->
    <button v-on:click="changeName()">改变div的内容</button>
   <!--4-->
    <button @click="changeName()">改变div的内容</button>

</div>
</body>
<script src="../js/vue.js"></script>
<script>
    new Vue({
        el:"#div",
        data:{
            name:"益达"

        },
        method:{
            changeName(){
                this.name="tom"
            }
        }
    });
    function changeName() {
        vue.name="jack"
    }
</script>
</html>